home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr54 / popmax1.zip / POPMAX.POP < prev    next >
Text File  |  1993-06-24  |  40KB  |  1,056 lines

  1.  
  2.                                    POPMAX!
  3.                      Interactive Ansi menus for Maximus BBS
  4.  
  5.  
  6. {:setup} -- Main Setup routines  * Make sure to answer questions below *
  7.                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  8.  
  9.  
  10.  Active BBS Port
  11.  ~~~~~~~~~~~~~~~
  12.  {setv active,4}  <--------+ What port is your modem on?
  13.                            | Set this to your active BBS port number
  14.  
  15.  Loocked Baud Rate
  16.  ~~~~~~~~~~~~~~~~~
  17.  {setv locked,38400} <-----| What is your locked baud rate?
  18.                            | Set this to your locked baud rate.
  19.                            | If you have a 2400 baud or lower speed modem
  20.                            | this option should be set to 0. (0=disabled)
  21.  
  22.  
  23.  Inactive Port
  24.  ~~~~~~~~~~~~~
  25.  {setv inact,2}   <--------+ Which port is inactive on your system?
  26.                            | Set this to a number of an  inactive port
  27.                            | on your system. This may be
  28.                            | any port on your system (1-4) that does not
  29.                            | have a modem hooked-up to it. ANSI sequences
  30.                            | will `bleed' on local display at high speeds.
  31.                            | Setting this to an inactive port will prevent
  32.                            | this from occuring. If you don't have one,
  33.                            | set this to your active port
  34.  
  35.  Mouse Port
  36.  ~~~~~~~~~~
  37.  {setv mousport,1} <------+ Which port is your mouse on?
  38.                           | Set this to your mouse port number. 0 = No Mouse
  39.  
  40.  Default Mouse Setting
  41.  ~~~~~~~~~~~~~~~~~~~~~
  42.  {setv mouseon,YES}<------+  Do you want to use the mouse online?
  43.                           |  Mouse default setting.
  44.                           | `YES' if you want mouse operation online
  45.                           | `NO' if you want don't want to use the mouse
  46.  
  47.  Hide Sysop Control
  48.  ~~~~~~~~~~~~~~~~~~
  49.  
  50.  {setv hide,NO} <-------+ When you move around menus while user is online,
  51.                         | do you want your movement to be hidden from user?
  52.                         | `YES' if you want your movements to be hidden
  53.                         | `NO' if you want movement to show to user
  54.  {return}
  55.  
  56.  
  57.  
  58. -----------------------------------------------------------------------------
  59.                           -end config section-
  60.                        No more questions to answer
  61. -----------------------------------------------------------------------------
  62.  
  63.                         ■ Program Code ■
  64.  
  65.  
  66.  
  67. ------------------------variable descriptions
  68.  
  69.  -->  `...' denotes this varible is an array.
  70.  
  71.  
  72. active                 modem port number
  73. actval                 character position of LTR in KEY
  74. aftblank               after-blank characters right of text (char)
  75. apenblank              number of blanks used to add to display text (numeric)
  76. araynam                array name to process (from,hold,count)
  77. barback                ansi sequences that make an erase of selector bar
  78. barct                  menu bar option counter
  79. barcol...              display column of menu bar options
  80. barrow...              display row of menu bar options
  81. bblankx                equal to SOL
  82. bcol                   menu bar column (left)
  83. biggest                length of longest option-text
  84. blanks                 blank string to extract blanks from (constant)
  85. boxwid                 width of box, based on length of longest option-text
  86. brow                   current row option-text will be displayed on
  87. c1                     corresponding letter from KEY based on value held in CC
  88. cc                     value of current number in array being processed
  89. chars                  current box text (with embedded blanks)
  90. city                   user's city (from Maximus)
  91. colref                 column wrap reference (last pos in menubar)
  92. clepoint               current row position to clear to end of display line
  93. comport                current port (from Maximus - unused)
  94. cop                    number of options in current menu
  95. copo                   number of options in current menu
  96. count...               array for old subname (numeric)
  97. curspeed               current modem speed detected when macro is initialized
  98. frame                  ansi sequences for box frame (middle)
  99. from...                array of option subnames from which current menu was called
  100. graphics               current graphics value (1=tty,2=ansi,3=avatar)
  101. hide                   default setting for hidden sysop control (yes,no)
  102. hilev                  highest possible menu level (constant)
  103. hold...                array where new subname is assembled (numeric)
  104. inact                  default inactive com port for bleed control (1-4)
  105. key                    range of letters for data subroutine names (a-z)
  106. keypress               value of last sysop arrow-key stroke (dna,rta,lfa,upa)
  107. key_cont               who is in control of menus (sysop,user)
  108. laslev                 last menu level (numeric)
  109. lbd                    left mouse-button down sequence (constant)
  110. lchar                  length of text options for box sizing
  111. lentx                  length of text  (numeric)
  112. lev                    current menu level (1-8)
  113. locked                 default locked value of modem port (0=not locked)
  114. lopt                   length of option (numeric)
  115. lrbu                   left or right button up sequence (constant)
  116. ltr                    current subroutine letter to be assembled from KEY (a-z)
  117. mbd                    middle mouse button down sequence (constant)
  118. mbu                    middle mouse button up sequence (constant)
  119. menbar                 current ansi menu bar attributes (B&W/white on cyan)
  120. menpop                 box attributes (B&W or Blue on White)
  121. minson                 user's minutes spent online re Maximus (numeric 0-?)
  122. mouseon                current state of sysop mouse operation (yes,no)
  123. mouseport              default mouse port (1-4)
  124. optc                   option counter (numeric 1-24)
  125. optnum                 current option number selector is positioned at (numeric)
  126. play                   current row display position based on option number (1-79)
  127. rbd                    right-button-down mouse sequence (constant)
  128. regcount               registration screen row count (1-7)
  129. regline                assembled ansi registration display line (constant)
  130. regline...             registration screen display lines copied (1-7)
  131. regone                 registration screen read-once flag (yes,no)
  132. reveal                 assembled user information display bar info (char)
  133. rimframe               rim of frame char attributes (B&W ansi/Color)
  134. rowref                 menu bar row pointer (usually 1-2)
  135. sol                    frame top chars for current box (char)
  136. selbar                 menu bar selector attributes (B&W or color)
  137. selpop                 box menu selector attributes (B&W or color)
  138. sendtxt                ansi sequences to send for popdown box middle (old opt or new)
  139. solblank               frame top chars for SOL to extract from (constant)
  140. speed                  current setting for adjusted active port speed (300-115200)
  141. state                  condition of use (local,online)
  142. subnam                 data subroutine name to begin gathering data from (ex. baaaaa)
  143. sur                    extracted IBM chars for box bottom (char)
  144. surblank               frame bottom chars for SUR to extract from (constant)
  145. syscodpz               character postion of {Commo} registration number in REGLINE...
  146. syspos                 character postion of registered user name in REGLINE..
  147. telefon                listed user's phone number from Maximus
  148. tempcol                current column position for box text display
  149. tempoint               subroutine name poition pointer for use during assembly of new sub name (1-8)
  150. tex                    current option text from TEX... array (char)
  151. tex...                 gathered option texts from data file (char)
  152. textlen                length of current option text from TEX (numeric)
  153. thetex                 text for menubar option (char)
  154. this...                subnames for associated subroutine options
  155. topspeed               top baud rate for given conditions (300-115200)
  156. tosub                  name of macro sub to goto based on keypress & menu display state
  157. txt...                 text options gathered from datafile (char)
  158. type                   current menu option command type (direct,indirect)
  159. type...                associated menu option command-types for current menu
  160. ufirst                 user first name from Maximus
  161. ulast                  user last name from Maximus
  162. verpos                 character poistion of {Commo} version from registration screen
  163. wrap                   menu bar length guage for wrap of menu bar (1-80)
  164. writct                 position counter for array (dis)assembly of subname
  165. xblank                 extracted number of blanks for inside boxframe (char)
  166. xbrow                  left box row position
  167.  
  168.  
  169. ---------------------------------end variable descriptions
  170.  
  171. ----- Mouse routines
  172.  
  173. {:msonoff}                                is mouse on or off?
  174. {call sysskey}
  175. {comp mousport,0}                         is mouse port disabled?
  176. {ifco-e rit}                              if so, return
  177. {comp mouseon,YES}                        is mouse toggle on?
  178. {ifco mouseon,mouseoff}                   if so set mouse on, els turn off
  179.  
  180. {:mouseoff}                               turn mouse driver off
  181. {setv mouseon,NO}                         set current mouse toggle setting
  182. {:offmouse}                               set mouse parms off
  183. {stat y}                                  turn on status bar
  184. {parm %speed%,,%active%,,}                return control to active port
  185. {ifca active,inact}                       ifcarrier on, make active else inactive
  186.  
  187.   {:inact}                                - set to inactive port
  188.   {parm %curspe%,,%inact%,,}                set inactive port to speed first recorded
  189.   {call reveal}                             show user info
  190.   {return}
  191.  
  192.   {:active}                               - reset to active port
  193.   {parm %speed%,,%active%,,}                set port active to online speed
  194.   {call reveal}                             show user info
  195.   {return}
  196.  
  197. {:mouseon}                                 -turn mouse on
  198. {comp key_cont,sysop}                       is sysop in control?
  199. {ifco ,rit}                                 if not, return
  200. {pops-c}                                    clear macrostack
  201. {setv mouseon,YES}                          set current mouse toggle ON
  202. {stat n}                                    turn off status bar for display
  203. {disp 25,1,4a, Escape key exits : Keep mouse still : Use buttons only : Double-click if stuck }
  204. {spdc n}                                    turn off serial port display
  205. {parm 1200,8n1,%mousport%,,}                set mouse parms
  206. {call reveal}                               show user stats
  207. {sete-p0 nf1}                               if sysop hits esc, same as F1
  208. {golo prelfa,%lbd}                          if left button pressed prepare LFA
  209. {golo prerta,%rbd}                          if right button, prepare RTA
  210. {look %mbd}                                 if middle button, prepare DNA
  211. {goto predna}                               prepare DNA
  212. {}
  213.  
  214.  
  215.   {:prelfa}                       - pre left arrow for mouse
  216.   {comp hide,NO}
  217.   {ifco ,LFA}
  218.   {call swprt}
  219.   {goto lfa}
  220.  
  221.   {:predna}   pre down arrow for mouse
  222.   {comp hide,NO}
  223.   {ifco ,DNA}
  224.   {call swprt}
  225.   {goto dna}
  226.  
  227.   {:prerta}   pre right arrow for mouse
  228.   {comp hide,NO}
  229.   {ifco ,RTA}
  230.   {call swprt}
  231.   {goto rta}
  232.  
  233.       {:swprt} - swap ports to show output to user while sysop is in mouse
  234.       {comp state,LOCAL}
  235.       {ifco ,swonline}
  236.       {parm %curspeed%,,%inact%,A,0}
  237.       {call reveal}
  238.       {return}
  239.  
  240.         {:swonline}
  241.         {parm %speed%,,%active%,A,0}
  242.         {call reveal}
  243.         {return}
  244.  
  245.  
  246.  
  247. {:mouseask}
  248. {setv _menu1,(X) Mouse Off}
  249. {setv _menu2,(O) Mouse On}
  250. {setv _mlabel,a,b,c,d,e,f,g,h,i,j,k,l,m,n,swxmOn,p,q,r,s,t,u,v,w,swXmoff,y,z}
  251. {menu 6,25, PopMax Menus}
  252. {return}
  253.  
  254. {:swxmon} - switch mouse on
  255. {setv mouseon,YES}
  256. {call msonoff}
  257. {return}
  258.  
  259. {:swxmoff}
  260. {setv mouseon,NO}
  261. {call msonoff}
  262. {return}
  263.  
  264.  
  265.  
  266.  
  267. ----------setup
  268.  
  269.  
  270.  
  271. {:nf2}                            F2 calls this subroutine
  272. {setesc-p0 nf1}
  273. {call setup}
  274. {setg 30,exit}
  275. {setl 60,gbye}
  276. {auto}                            clear-out auto-recieve strings
  277. {sound n}                         sound off
  278. {:begin}
  279. {elap}                            reset the elapsed timer
  280. {setv graphics,1}                 set default graphics rendition to ansi 
  281. {call r_grf}                      read dorhal information
  282. {call reveal}
  283. {call register}
  284. {return}
  285.  
  286. ---registration info
  287.  
  288. {:register}- take snapshot of registration
  289. {comp regline,}
  290. {ifco ,rit}
  291. {call writreg}
  292. {setv regcount,0}
  293. {ropen register.yes,rit}
  294. {call readreg}
  295. {rclos}
  296. {wclos}
  297. {call sortreg}
  298. {setv regone,yes}
  299. {return}
  300.  
  301. {:writreg}
  302. {ifex %_hom%\register.yes,rit}
  303. {capm f}
  304. {scre y,register.yes}
  305. {return}
  306.  
  307. {:sortreg}
  308. {instr regline2,to}
  309. {setv verpos,%_pos}
  310. {incr verpos,3}
  311. {subst regline2,%verpos%,100,%regline2}
  312. {inst regline6,to}
  313. {setv syspos,%_pos}
  314. {incr syspos,5}
  315. {subs regline6,%syspos%,100,%regline6}
  316. {inst regline7,Number}
  317. {setv syscodpz,%_pos}
  318. {incr syscodpz,09}
  319. {subs regline7,%syscodpz%,100,%regline7}
  320. {setv regline,^[[24;1H^[[1;33;41m `?' for Help ^[[0m^[[K %regline2% - Reg: #%regline7%, %regline6%^[[K^M}
  321. {return}
  322.  
  323. {:readreg}
  324. {incr regcount}
  325. {comp regcount,8}
  326. {ifco-g rit}
  327. {read %regline%regcount}
  328. {goto readreg}
  329.  
  330. ---------- get door information
  331.  
  332. {:c_grf}                         This sub is for mono graphics users
  333. {comp graphics,0}                is user graphics mode TTY?
  334. {ifco-e ,rit}                    if not, return
  335. {setv rimframe,^[[0m}            set special frame chars' attributes
  336. {setv frame,^[[0m}               set fram of pop-down box's attributes
  337. {setv selbar,^[[7m}              set menu bar's selector bar attributes
  338. {setv menbar,^[[0m}              set menu bar attributes
  339. {setv selpop,^[[7m}              set selector bar attibutes, pop-down box
  340. {setv menpop,^[[0m}              set set menu attributes, pop-down box
  341. {setv barback,^[[1;1H^[[0m%blanks}   set background of selector bar
  342. {return}
  343.  
  344. {:r_grf}                          read dorhal information & set ports
  345. {ropen popmax.def}                read first line in .def
  346. {read %graphics}                  read type of graphics user has
  347. {read %comport}                   read the port number
  348. {read %speed}                     read the baud rate
  349. {read %key_cont}                  read security level of who is on (key control)
  350. {read %telefon}                   read phone number of user
  351. {read %ufirst}                    first name
  352. {read %ulast}                     last name
  353. {read %city}                      city
  354. {read %minson}                    minutes left
  355. {rclos}                           close the file
  356. {comp speed,0}                    is this a local login?
  357. {ifco-e setspe}                   if true, set the port to inactive
  358. {comp locked,0}                   is our locked baud rate disabled?
  359. {ifco-g setlock}                  if not, set to locked rate
  360. {setv state,ONLINE}               set state to ONLINE
  361. {setv topspeed,%speed}            non-locked, set top speed to actual baud rate
  362. {dparm %speed%,,%active%,a,}      non-locked, set default parms to baudrate
  363. {parm %speed%,,%active%,a,}       non-locked, set current parms to baudrate
  364. {return}
  365.  
  366. {:setspe} - set speed for local login
  367. {setv state,LOCAL}                set current state to LOCAL
  368. {setv speed,%topspeed}            since local, set to top modem speed
  369. {parm %speed%,,%inact%,a,}        set inactive port current parms to baudrate
  370. {dparm %speed%,,%inact%,a,}       set inactive port default parms to baudrate
  371. {return}
  372.  
  373. {:setlock} - set locked baud rate
  374. {setv state,ONLINE}                current modem state is ONLINE
  375. {setv topspeed,%locked}            set highest speed to locked rate
  376. {setv speed,%locked}               since false, set to top modem speed
  377. {parm %speed%,,%active%,a,}        set default parms to baudrate
  378. {dparm %speed%,,%active%,a,}       set default parms to baudrate
  379. {return}
  380.  
  381.  
  382. ----- sysop menu
  383.  
  384. {:nf1}
  385. {:sysmen}---sysop menu
  386. {setv _menu1,X eXit to max menus}
  387. {setv _menu2,S Sysop menu control (disables user)}
  388. {setv _menu3,U User menu control (disables sysop)}
  389. {setv _menu4,H Hangup}
  390. {setv _menu5,N Compile new outline file}
  391. {setv _menu6,E Edit outline file}
  392. {setv _menu7,D Read Popmax Documents}
  393. {setv _menu8,Q Halt Macro}
  394. {setv _mlabel,a,b,c,Docs,Edfile,f,g,gbye,i,j,k,l,Mouseask,Cofile,o,p,quitmac,r,sysopctl,t,Userctl,v,w,exitmen,y,z}
  395. {menu 12,45, PopMax Sysop Screen}
  396. {goto stt}
  397.  
  398. {:quitmac}
  399. {pops-c}
  400. {}
  401.  
  402. {:docs}
  403. {help}
  404. {goto nf1}
  405.  
  406. {:Edfile} - Edit outline file
  407. {edit outline.pop}
  408. {goto sysmen}
  409.  
  410. {:cofile} - compile outline file
  411. {macl compile.pop,alk}
  412. {}
  413.  
  414. {:reveal} - reveal user stats
  415. {disp 23,1,1a,                                                                                }
  416. {setv reveal, %ufirst% %ulast%, %city% : %minson% mins : %_por,%_fmt,%_spe : typed=> }
  417. {disp 23,1,1a,%reveal
  418. {return}
  419.  
  420. {:sysopctl}----enable sysop keys
  421. {setv key_cont,sysop}
  422. {call mouseask}
  423. {call sysskey}
  424. {goto stt}
  425.  
  426. {:userctl}----diable user keys
  427. {call swxmoff}          switch out of mouse port if any
  428. {setv key_cont,user}    restore key control to user
  429. {call sysskey}
  430. {comp hide,YES}         was user restored just after sysop did hidden cmds?
  431. {ifco alj}              if so, begin at top
  432. {goto stt}              since not wait for input
  433.  
  434. {:helpu}  - Help file display
  435. {clear}
  436. {send ^[[2J}
  437. {ifca ,nousr}               if user isn't there, recycle
  438. {ifex gui_hlp.pop,,nohelp}  if file isn't there, say so
  439. {asci-e gui_hlp.pop,}       send help file via askey upload
  440. {pops-c}                    clear out stack
  441. {goto alj}                  return to beginning of program
  442.  
  443. {:nohelp}  - No help file avail
  444. {send ^[[3;2H A help file is not Available.}     Text
  445. {pops-c}                                         clear stack
  446. {goto alj}                                       recycle
  447.  
  448. {:nousr}-no user online to show help screen to : sysop in local mode
  449. {clear}                                                     clear screen
  450. {display 2,1,2,This option is not available in local mode}  Sysop is on, tell him
  451. {goto alj}                                                  recycle
  452.  
  453. {:exitmen} - Exit menus back to Maximus
  454. {wopen choice.mec}               open choice file
  455. {writ [key_poke]q}               put in quit command
  456. {wclos}                          close
  457. {exit}                           leave Popmax
  458.  
  459. {:endconfig}--execute this if person hit left arrow
  460. {exit}
  461. {}
  462.  
  463. {:stt} stop----------------stop subroutines, waiting for keypress
  464. {call reveal}
  465. {call sysskey}
  466. {pops-c}                   clear out stack pointer
  467. {comp key_cont,user}       does user have control?
  468. {ifco user_stt}            if so, wait for remote input
  469. {call msonoff}             if so, do mouse subroutines
  470. {}                         else, user is sysop no mouse, so wait here for key
  471.  
  472. {:user_stt}-----------------user stop, if key control is under user
  473. {setesc-p0 nf1}            if escapes hit, NF1 (for sysop)
  474. {comp lev,1}               are we in menu bar?
  475. {ifco-e stt1}              if so, goto different wait scheme
  476. {setl 60,gbye}             in 60 seconds, hangup if no keypress
  477. {noca gbye}                if no carrier, hangup
  478. {parm ,,,T,}               set to TTY
  479. {golo lfa,^[}              look for keypresses: escape (left-arrow)
  480. {golo upa,H}                                   up-arrow keyboard doorway
  481. {golo dna,P}                                   down-arrow keyboard doorway
  482. {golo lfa,K}                                   left-arrow keyboard doorway
  483. {golo rta,M}                                   right-arrow keyboard doorway
  484. {golo rta,|}                                    enter key (right-arrow)
  485. {golo upa,8}                                    #8 numeric keypad (Up)
  486. {golo dna,2}                                    #2 numeric keypad (Down)
  487. {golo lfa,4}                                    #4 numeric keypad (Left)
  488. {golo rta,6}                                    #6 numeric keypad (Right)
  489. {golo dna, }                                    Space (Down)
  490. {look ?}                                        Question Mark (Help)
  491. {call helpu}                                    go here is ? is pressed
  492. {goto alj}                                      in timeout, recycle
  493.  
  494. {:stt1}         - This is very similar to above, but for menu bar at top
  495. {setl 60,gbye}
  496. {noca gbye}
  497. {parm ,,,T,}
  498. {golo upa,^[}
  499. {golo upa,H}
  500. {golo lfa,K}
  501. {golo dna,P}
  502. {golo rta,M}
  503. {golo dna,|}
  504. {golo upa,8}
  505. {golo dna,2}
  506. {golo lfa,4}
  507. {golo rta,6}
  508. {golo dna, }
  509. {look ?}
  510. {call helpu}
  511. {goto alj}
  512.  
  513. {:gbye}---exit menus
  514. {sign-d0}                hold DTR low
  515. {pause 3}                pause for 3
  516. {sign-d1}                DTR high
  517. {break}                  send break
  518. {wopen choice.mec}       open choice file
  519. {writ [key_poke]qgyn}    goodbye sequence
  520. {wclos}                  close
  521. {exit}                   Exit POPMAX
  522.  
  523. {:execute}---exit to maximus with selected option
  524. {setv-s thisopt,opt%optnum}      store selection in expanded var to normal var
  525. {wopen choice.mec}               open choice file (willbe compiled)
  526. {writ %thisopt}                  write Mecca token associated with selection
  527. {wclos}                          close choice file
  528. {pops-c}                         clear return stack
  529. {rclos}                          close file
  530. {call exit}                      leave POPMAX to compile & execute token
  531.  
  532. {:exit}       - Exit POPMAX
  533. {send ^[[0m^[[2J}                 clear screen
  534. {exit}                            Exit
  535.  
  536. {:useron} - user is online, set these vars
  537. {hflo n}
  538. {sflo n}
  539. {loca y}
  540. {spdc y}
  541. {spoc y}
  542. {return}
  543.  
  544. {:wait}
  545. {call chekloc}       see if sysop is using in local mode
  546. {:wait1}
  547. {setv copo,%optc}    back up option counter
  548. {comp type,direct}   is it a direct (not-to-another-menu command?)
  549. {ifco backup}        if so, backup
  550. {setv optnum,1}      reset option number for display
  551. {call disptxt}       anyway, display text
  552. {setv optc,0}        reset option counter for this set to 0
  553. {setv araynam,hold}  set array pointer to the HOLD array
  554. {call setless}          clear it out? (unsure)
  555. {setv araynam,count}    set current array to COUNT
  556. {goto stt}              wait for input
  557. {}
  558.  
  559. {:chekloc}  see if sysop is using in local mode
  560. {parm %speed%,%active%,,,}        check modem port for user's carrier
  561. {ifca useron}                     if he's there, run commands for online user
  562. {sflo n}                          turn off XON XOFF (for ^S)
  563. {hflo n}                          hardware control off
  564. {loca y}                          Local echo on
  565. {spdc y}                          serial port display OK
  566. {spoc n}                          no serial port output
  567. {return}
  568.  
  569. {:disptxt}---display text
  570. {setv biggest,0}
  571. {setv play,0}
  572. {setv cop,%optc}
  573. {comp lev,1}
  574. {ifco-e disbar}
  575. {call maxwid}
  576. {call disptxt1}
  577. {return}
  578.  
  579. {:disptxt1}
  580. {setv boxwid,%biggest}                 set boxwidth to longest option text
  581. {incr boxwid,2}                        add two to this for margins
  582. {subst %xblank,1,%boxwid,%blanks}      get correct number of blanks
  583. {setv %xblank,%xblank%}                append these with frame ends
  584. {subs sol,1,%boxwid,%solblank}         get proper number of frame bottoms
  585. {setv bblankx,%sol%}                   append top with frame ends
  586. {subs sur,1,%boxwid,%surblank}         get proper number of frame bottoms
  587. {call disptxt2}                        call second display text sub
  588. {setv play,1}
  589. {call newcolor}
  590. {return}
  591.  
  592. {:disptxt2}
  593. {setv play,1}                                reset
  594. {leng %tex}                                  get length of text
  595. {setv lentx,%_len}                           put in lentx
  596. {incr brow,2}                                increment row
  597. {setv tempcol,%bcol}                         set left margin with left of selector bar option
  598. {send ^[[%brow%;%tempcol%H^[[s%rimframe%▌%frame%%bblankx%%rimframe%▐}
  599. {decr brow,2}
  600. {call disptxt3}
  601. {return}
  602.  
  603. boxwid-textlen-3=#appendblanks
  604.  
  605. {:disptxt3}
  606. {setv sendtxt,^[[s▌^[[%boxwid%C▐^[[u^[[B}
  607. {send ^[[u%rimframe%}
  608. {call sendblan}
  609. {send %sendtxt}
  610. {send %rimframe%▌%frame%%sur%%rimframe%▐}
  611. {send %menpop}
  612. {call sendopts}
  613. {return}
  614.  
  615. {:sendblan}
  616. {send %sendtxt}
  617. {incr play}
  618. {comp play,%cop}
  619. {ifco-g rit}
  620. {goto sendblan}
  621.  
  622. {:sendchar}
  623. {call newchars}
  624. {setv sendtxt,^[[%xbrow%;%tempcol%H%chars%}
  625. {send %sendtxt}
  626. {incr xbrow}
  627. {incr play}
  628. {comp play,%cop}
  629. {ifco-g rit}
  630. {goto sendchar}
  631.  
  632. boxwid-textlen-3=#appendblanks
  633.  
  634. {:newchars}
  635. {setv-s chars,txt%play}
  636. {leng %chars}
  637. {setv textlen,%_len}
  638. {setv apenblan,%boxwid}
  639. {decr apenblan,%textlen}
  640. {decr apenblan}
  641. {subs aftblank,1,%apenblan,%blanks}
  642. {setv chars, %chars%%aftblank}
  643. {return}
  644.  
  645. {:sendopts}------send text options
  646. {setv play,1}
  647. {incr tempcol}                                increment left-margin for text
  648. {setv xbrow,%brow}
  649. {incr xbrow,3}
  650. {call newchars}
  651. {setv sendtxt,^[[%brow%;%tempcol%H%chars%}
  652. {call sendchar}
  653. {return}
  654.  
  655. {:maxwid}-----get maximum width of longest string
  656. {incr play}
  657. {comp play,%cop}
  658. {ifco-g rit}
  659. {setv-s chars,txt%play}
  660. {leng %chars}
  661. {setv lchar,%_len}
  662. {comp lchar,%Biggest}
  663. {ifco-le maxwid}
  664. {setv biggest,%lchar}
  665. {goto maxwid}
  666.  
  667.  
  668. {:disbar}---- if menu level one, display menu bar
  669. {call setbar}                call setup for this set of subroutines
  670. {call disbar1}               define locations for bar menu
  671. {call barshow}               show options at locations
  672. {call newco1}                display newcolor at current pos
  673. {call sysskey}
  674. {comp regone,yes}
  675. {ifco onereg}
  676. {return}
  677.  
  678. {:onereg}
  679. {setv regone}
  680. {send %regline}
  681. {return}
  682.  
  683. {:sysskey}
  684. {comp key_cont,sysop}
  685. {ifco lokey,onlkey}
  686.  
  687. {:onlkey} -- online
  688. {disp 24,1,4e, SysMenu <esc> }
  689. {call reveal}
  690. {return}
  691.  
  692. {:lokey} - sysop info key, local
  693. {comp mouseon,NO}
  694. {ifco ,onlkey}
  695. {disp 24,1,4e, Sysop Menu F1 }
  696. {call reveal}
  697. {return}
  698.  
  699. {:setbar}--setup for menu bar
  700. {setv wrap,1}                establish wrap mesaurement guage WRAP as num
  701. {setv colref,1}              set initial column reference pointer
  702. {setv rowref,1}              initialize row refernce pointer
  703. {setv barct,0}               reset bar option pointer
  704. {call disbar1}               call main body of bar subroutines
  705. {return}
  706.  
  707. {:disbar1}----main body of bar counter
  708. {incr %barct}                bring up our option pointer
  709. {comp barct,%copo}           compare pointer with highest option number
  710. {ifco-g rit}                 if it is over, return
  711. {call lenopt1}               get the length of particular option, menu level 1
  712. {call getlox}                assign screen locations for these options
  713. {goto disbar1}               cycle until released
  714.  
  715. {:lenopt1}----get length of test for menu option in menu bar
  716. {setv-s thetex,txt%barct}    store the current option in THETEX
  717. {leng %thetex}               get the length of the text
  718. {setv lopt,%_len}            store in LOPT
  719. {incr lopt,2}                increment this by two to get length with display spaces
  720. {return}
  721.  
  722. {:getlox}---assign screen coordinates for the menu bar options
  723. {incr wrap,%lopt}            add option text length to var WRAP
  724. {comp wrap,80}               compare it to 80 (screen width)
  725. {ifco-ge wrapit}             if greater or equal, wrap row
  726. {setv barcol%barct,%colref}  assign current column refernce to array BARCOL
  727. {setv barrow%barct,%rowref}  assign current row refernce to array BARROW
  728. {setv colref,%wrap}          set the column refernce to the WRAP value
  729. {return}
  730.  
  731.   {:wrapit}----since we have reached end of row, wrap option to next line
  732.   {setv colref,1}              reset column pointer to first position
  733.   {incr rowref}                increment row pointer to next row
  734.   {setv barcol%barct,%colref}  assign current column refernce to array BARCOL
  735.   {setv barrow%barct,%rowref}  assign current row refernce to array BARROW
  736.   {setv wrap,1}                reset our wrap guage
  737.   {incr wrap,%lopt}            add this option's length to wrap guage
  738.   {setv colref,%wrap}          establish WRAP as the CURROW
  739.   {return}
  740.  
  741. {:barshow}---display current option atdefined location
  742. {setv barct,0}               reset bar counter
  743. {send %barback}              send background color for menu bar
  744. {send %menbar}               set color for menu bar
  745. {call barshow1}              cycle through options and display
  746. {return}
  747.  
  748. {:barshow1}----cycle thru menu bar options, and display
  749. {incr barct}                    increment our bar option pointer
  750. {comp barct,%copo}              compare pointer with highest option number
  751. {ifco-g rit}                    if it is over, return
  752. {setv-s brow,barrow%barct}      assign option in array BARROW to static var
  753. {setv-s bcol,barcol%barct}      assign option in array BARCOL to static var
  754. {setv-s thetex,txt%barct}       assign text of option to static var THETEX
  755. {send ^[[%brow%;%bcol%H%thetex} display it
  756. {goto barshow1}
  757.  
  758.  
  759. {:backup}----back one level
  760. {call turnover}
  761. {setv subnam}
  762. {setv writct,0}
  763. {call asm}
  764. {call selcolor}
  765. {setv type,indirect}
  766. {return}
  767. {goto alj}
  768.  
  769. -------------------------------------------------------------------------------
  770.  
  771. {:sortspeed}
  772. {wclos}
  773. {parm ,,%active%,A,}
  774. {dpar ,,,A,}
  775. {comp locked,0}
  776. {ifco-e ,highspeed}
  777. {setv topspeed,%_spe}
  778. {return}
  779.  
  780. {:highspeed}
  781. {setv topspeed,%locked}
  782. {return}
  783.  
  784. {:alj}---- Begin here
  785. {wclos}
  786. {pops-c}
  787. {call nf2}
  788. {call set2}                     setup routines (reset vars)
  789. {setv writct,0}
  790. {call asm}                      assemble COUNT array into alphabetic labelname
  791. {setv from%lev,%subnam}         store top option of current menu for recall
  792. {macl popdata.pop,top}          load our data file at the TOP subroutine
  793. {}                              since macro reloads at :WAIT, no more here
  794.  
  795.  
  796.  
  797.  
  798. {:set2}---setvars
  799. {setv curspe,%_spe}                   get initial speed of modem
  800. {setv lbd,α@└}                        left button down
  801. {setv lrbu,└@└}                       left button up /right button up
  802. {setv mbd,@@Φ}                        middle button down
  803. {setv mbu,└@@α}                       middle button up
  804. {setv rbd,╨@└}                        right button down
  805. {curs n}                              turn cursor off
  806. {setv solblank,▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀}
  807. {setv surblank,▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄}
  808. {setv blanks,                                                                               }
  809. {setv lchar,0}                        LCHAR, numeric length of text in box
  810. {setv biggest,0}                      BIGGEST numeric out of all Lchars
  811. {setv barback,^[[1;1H^[[1;46m%blanks} blanks colors
  812. {setv rimframe,^[[0;44;30m}           rim-of-frame colors
  813. {setv frame,^[[0;34;47m}              frame colors
  814. {setv selbar,^[[1;33;41m}             selector bar colr for top menu bar
  815. {setv menbar,^[[0;30;47m}             inactive color for top menu bar
  816. {setv selpop,^[[0;30;46m}             selector bar color for pop-down menus
  817. {setv menpop,^[[0;47;31m}             inactive color for pop-down menus
  818. {call c_grf}                          reset graphics to tty if neccesary
  819. {setv copo,0}                         reset couter of options COPO
  820. {setv hilev,8}                        set hilevel counter to four
  821. {setv araynam,count}                  assign array name COUNT for assembly
  822. {call setless}                        reset higher menu levels to zero
  823. {setv optc,0}                         reset option counter
  824. {setv type}                           clear command status value boolean (direct,indirect)
  825. {setv subnam}                         clear translated labelname (alphabetic)
  826. {setv key,abcdefghijklmnopqrstuvwxyz} define numeric-alphbetic conversion key
  827. {setv lev,1}                          set current menu level to one
  828. {setv optnum,1}                       set current option number to 1
  829. {setv cc,1}                           establish cc (temp var) as numeric
  830. {setv laslev,0}                       reset last level to zero
  831. {setv count1,1}                       first option to baaa (1000)
  832. {return}
  833.  
  834. {:setless}                         ---set levels to the right in sublabel
  835.                                       (higher levels) to zero
  836.                                       ex: bcda  -> baaa (or) 1230  -> 1000
  837. {setv writct,0}                          clear temporary counter
  838.   {:setl1}                               find position
  839.   {incr writct}                          increment counter
  840.   {comp writct,%hilev}                   compare to last pointer pos
  841.   {ifco-g rit}                           if less, letter pos to zap is found
  842.   {setv %%araynam%%writct,0}             reset value in current expanded var
  843.   {goto setl1}                           repeat
  844.  
  845. {:comp2}--compare level number read from file
  846. {comp laslev,%lev}      compare val of lastlevel pointer to current level pointer
  847. {ifco-l rta}            if last num < current, up level pointer
  848. {ifco-e upa}            if last num=current increment value held at pointer
  849. {ifco-g lfa}            if last num > current decrement level pointer
  850. {}
  851.  
  852. {:cleol}-------clear out old options on screen
  853. {setv clepoint,24}                     we will clear from line 24
  854. {send ^[[0m^[[23;1H}
  855. {call cleol1}
  856. {call reveal}                          reveal user stats
  857. {return}
  858.  
  859. {:cleol1}-----clear screen
  860. {decr clepoint}                       decrement screen row counter
  861. {comp clepoint,1}                     are we at menu bar?
  862. {ifco-e rit}                          if so, return
  863. {send ^[[K}                           clear to end of line
  864. {send ^[[A}                           move up
  865. {goto cleol1}                         repeat
  866.  
  867. {:turnover}---turnover counter
  868. {comp lev,1}
  869. {ifco-e rit}
  870. {decr lev}                       drop one level
  871. {setv count%lev,1}
  872. {setv writct,%lev}               mark beginning position of reset pointer
  873. {call setless}                   reset all vars to right back to zero
  874. {return}
  875.  
  876. {:selcolor}---show an option has been selected
  877. {setv-s tex,txt%optnum}
  878. {send ^[[%optnum%;10H%menpop%%tex}
  879. {return}
  880.  
  881. {:oldcol1}- for menu bar
  882. {setv-s tex,txt%optnum}
  883. {setv-s brow,barrow%optnum}
  884. {setv-s bcol,barcol%optnum}
  885. {send ^[[%brow%;%bcol%H%menbar%%tex}
  886. {return}
  887.  
  888. {:oldcolor}
  889. {comp lev,1}
  890. {ifco-e oldcol1}
  891. {setv play,%optnum}
  892. {call newchars}
  893. {incr play,3}
  894. {send ^[[%play%;%tempcol%H%menpop%%chars}
  895. {return}
  896.  
  897. {:newco1} -- for menu bar
  898. {setv-s tex,txt%optnum}
  899. {setv-s brow,barrow%optnum}
  900. {setv-s bcol,barcol%optnum}
  901. {send ^[[%brow%;%bcol%H%selbar%%tex}
  902. {return}
  903.  
  904. {:newcolor}
  905. {comp lev,1}
  906. {ifco-e newco1}
  907. {setv play,%optnum}
  908. {call newchars}
  909. {incr play,3}
  910. {send ^[[%play%;%tempcol%H%selpop%%chars}
  911. {return}
  912.  
  913.  
  914.  
  915. {:dna}
  916. {parm ,,,a,}
  917. {spdc y}
  918. {setv keypress,dna}                set our keypress var to down-arrow
  919. {call testbar}                     test the keypress, and act
  920.  {:barrta}
  921.  {comp optnum,%copo}                else compare with last menu option
  922.  {ifco-ge totop}                    if equal, selector bar to top
  923.  {call oldcolor}                    else print od color
  924.  {incr optnum}                      increment our option numberr in this menu
  925.  {setv-s subnam,thopt%optnum}       reset sub name to reflect new option
  926.  {call newcolor}                    call our new color
  927.  {goto stt}
  928.  
  929.  
  930. {:totop}---back to top again
  931. {call oldcolor}
  932. {setv optnum,1}
  933. {setv count%lev,1}
  934. {setv subnam}
  935. {call asm}
  936. {setv araynam,count}
  937. {call newcolor}
  938. {goto stt}
  939.  
  940. {:tobot}--back to bottom again
  941. {call oldcolor}
  942. {setv optnum,%copo}
  943. {setv count%lev,%copo}
  944. {setv subnam}
  945. {setv araynam,count}
  946. {call asm}
  947. {call newcolor}
  948. {goto stt}
  949.  
  950. {:barupa}---check bar for option above it
  951. {goto alj}
  952.  
  953.  
  954. {:upa}
  955. {spdc y}
  956. {parm ,,,a,}
  957. {setv keypress,upa}
  958. {call testbar}
  959. {:barlfa}--let-arrow keypress
  960. {comp optnum,1}
  961. {ifco-le tobot}
  962. {call oldcolor}
  963. {decr optnum}
  964. {setv-s subnam,thopt%optnum}
  965. {call newcolor}
  966. {goto stt}
  967.  
  968. {:testbar}---test boolean
  969. {comp lev,1}
  970. {ifco-g rit}
  971. {setv tosub,bar%keypress}
  972. {goto %tosub}
  973. {return}
  974.  
  975. {:rta}
  976. {parm ,,,a,}
  977. {spdc y}
  978. {setv keypress,rta}
  979. {call testbar}
  980.   {:uplev}---increment level pointer
  981. {:bardna}
  982.   {comp lev,%hilev}                  have we reached highest menu level?
  983.   {ifco-e rit}                       if equal, return
  984.   {setv writct,0}                    reset assembly pointer
  985.   {setv araynam,hold}                set our array name to HOLD
  986.   {setv-s subnam,this%optnum}        set our subroutine name to current pos name
  987.   {comp type%optnum,direct}
  988.   {ifco execute}
  989.   {call disasm}                      disassemble this sub name
  990.   {incr lev}                         increment our menulevel in HOLD
  991.   {incr hold%lev}                    and increment value held in that level
  992.   {setv subnam}                      reset subroutine name
  993.   {call asm}                         reassemble subroutine name
  994.   {call setless}                     zero-out values stored in HOLD array
  995.   {setv from%lev,%subnam}            store top option of current menu for recall
  996.   {macl popdata.pop,top}             execute newly asssembled label
  997.  
  998. {:lfa}
  999. {parm ,,,a,}
  1000. {spdc y}
  1001. {setv keypress,lfa}
  1002. {call testbar}
  1003. {:downlev}-- decrement level pointer
  1004. {:barlfa}--let-arrow keypress
  1005. {comp lev,1}                       is menu level at one?
  1006. {ifco-e rit}                       if so, return
  1007. {call cleol}
  1008. {decr %lev}                        else, drop our level pointer by one level
  1009. {setv-s subnam,from%lev}           recall previous menu label at top option
  1010. {setv araynam,from}                set current array name to FROM
  1011. {send %regline}                    send registration info
  1012. {macl popdata.pop,top}             execute a recall of previous menu
  1013.  
  1014. {:asm}---assemble sub name
  1015. {call assemble}
  1016. {return}
  1017.  
  1018. {:assemble}
  1019. {incr writct}                 increment position counter
  1020. {comp writct,%hilev}          is counter greater than highest count?
  1021. {ifco-g rit}                  if true display
  1022. {setv-s cc,%araynam%%writct}  store current val under temp pointer to cc
  1023. {incr cc}                     add one to value so zero can be accounted for-count
  1024. {subs c1,%cc%,1,%key}         find the representative letter in key  (count)
  1025. {setv subnam,%subnam%%c1}     append subroutine name
  1026. {goto assemble}
  1027.  
  1028. {:rit}
  1029. {return}
  1030.  
  1031.  
  1032. -----------disassemble alphabetic label
  1033.  
  1034. input: subnam
  1035. output: corresponding elements in HOLD array
  1036.  
  1037.  
  1038. {:disasm}--setup for dissassemble
  1039. {setv tempoint,0}                reset temporary pointer variable
  1040.  
  1041. {:disasm1}----cycle through each letter, and convert to numbers
  1042. {incr tempoint}                  increment string positon pointer
  1043. {comp tempoint,%hilev}           compare temporary pointer with hilev
  1044. {ifco-g rit}                     if it's greater, were done dissembling
  1045. {subs %ltr%,%tempoint%,1,%subnam}get letter LTR at TEMPOINT position from SUBNAM
  1046. {instr key,%ltr}                 what is position of this letter in KEY?
  1047. {setv actval,%_pos}              place corresponding (tempoint) element in array HOLD to the position of letter LTR in KEY
  1048. {decr actval}                    decr ACTVAL to reflect actual numeric value
  1049. {setv hold%tempoint,%actval}     set corresponding (tempoint) element in array HOLD to the position of letter in KEY
  1050. {goto disasm1}
  1051.  
  1052. -----------------------------------------------------------------------------
  1053.                               #####
  1054. -----------------------------------------------------------------------------
  1055.  
  1056.